<template>
  <div class="suggestion">
    <head-top head-title="意见回答" goBack="true"></head-top>
    <div class="problem">
      <div class="msg_title">
        <img src="./images/problem.png" alt="">
        <span>问题：</span>
      </div>
      <div class="msg_content">
        <p>{{msg.content}}</p>
      </div>
    </div>
    <div class="lines"></div>
    <div class="answer">
      <div class="ans_title">
        <img src="./images/answer.png" alt="">
        <span>回答：</span>
      </div>
      <div class="ans_content">
        <p>{{msg.reply_content}}</p>
      </div>
    </div>
  </div>
</template>
<style lang="scss">
  .suggestion {
    width: 100%;
    padding-top: 40px;
    background: #fff;
    .problem {
      .msg_title {
        width: 100%;
        height: 44px;
        /*background: #f6f6f6;*/
        img {
          display: inline-block;
          line-height: 44px;
          margin-top: 8px;
          float: left;
          width: 25px;
          margin-left: 5px;
        }
        span {
          font-size: 15px;
          line-height: 44px;
          color: #167CD4;
          margin-left: 5px;
        }
      }
      .msg_content {
        width: 100%;
        p {
          font-size: 13px;
          padding: 10px;
          line-height: 25px;
        }
      }
    }
    .lines{
      width: 100%;
      height: 1px;
      background: #f2f2f2;
    }
    .answer {
      .ans_title {
        width: 100%;
        height: 44px;
        /*background: #f6f6f6;*/
        img {
          display: inline-block;
          line-height: 44px;
          margin-top: 8px;
          float: left;
          width: 25px;
          margin-left: 5px;
        }
        span {
          font-size: 15px;
          line-height: 44px;
          color: #fd2b33;
          margin-left: 5px;
        }
      }
      .ans_content {
        width: 100%;
        p {
          font-size: 13px;
          padding: 10px;
          line-height: 25px;
        }
      }
    }
  }
</style>
<script>
  import headTop from '../header/Header.vue'
  import commonUrl from '../../common/js/commonUrl.js'

  export default {
    name: 'OpinionDetail',
    data () {
      return {
        msg: {}
      }
    },
    components: {
      headTop
    },
    created () {
      this.getOPinions()
    },
    methods: {
      getOPinions () {
        const url = `${commonUrl.apihost}index.php/home/personal/getSuggestion/?id=${this.$route.params.id}`
        this.$http.get(url).then(res => {
          if (res.data.code === 200) {
            this.msg = res.data.data
            // console.log(this.msg)
          }
        })
      }
    }
  }
</script>
